package com.ysd.lis.controller;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.WkKnowledgeApproval;
import com.ysd.lis.request.KnowledgePageParam;
import com.ysd.lis.service.WkKnowledgeApprovalService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 员工表
 * 前端控制器
 * </p>
 *
 * @author peng
 * @since 2024-03-21
 */
@Api(tags = "知识库审核表")
@RestController
@RequestMapping("/api/wk/wkKnowledgeApproval")
public class WkKnowledgeApprovalController extends BaseController {

    @Autowired
    WkKnowledgeApprovalService wkKnowledgeApprovalService;

    @ApiOperation("查询需要审批得树形结构")
    @GetMapping("/findContentApprovalTree")
    public Result findContentApprovalTree(KnowledgePageParam param){
        return wkKnowledgeApprovalService.findContentApprovalTree(param);
    }

    @GetMapping("/getContentAndApprovaByContentId")
    public Result getContentAndApprovaByContentId(KnowledgePageParam param) {
        return wkKnowledgeApprovalService.getContentAndApprovaByContentId(param);
    }

    @PostMapping("/submitApproval")
    public Result submitApproval(@RequestBody WkKnowledgeApproval approval){
        return wkKnowledgeApprovalService.submitApproval(approval);
    }

    @ApiOperation("查询审批记录")
    @GetMapping("/findApprovalListByContentId")
    public Result findApprovalListByContentId(KnowledgePageParam param){
        return wkKnowledgeApprovalService.findApprovalListByContentId(param);
    }


}
